//
//  ViewController.m
//  TodayPlayWhat
//
//  Created by 作者 on 16-5-19.
//  Copyright (c) 2016年 HCY. All rights reserved.
//

#import "ViewController.h"
#import "FirstViewController.h"
#import "ClassificationViewController.h"
#import "MessageViewController.h"
#import "PersonalViewController.h"
@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    
    [self prepare];
    
}

- (void)prepare
{

    UITabBarController * bar = [[UITabBarController alloc]init];
    
    bar.tabBar.tintColor = [UIColor blackColor];
   
    
    FirstViewController * firstVC = [[FirstViewController alloc]init];
    
    firstVC.tabBarItem.title = @"首页";
    
    firstVC.tabBarItem.image = [[UIImage imageNamed:@"icon_tab1_normal"]imageWithRenderingMode:(UIImageRenderingModeAlwaysOriginal)];
    
    firstVC.tabBarItem.selectedImage =[[UIImage imageNamed:@"icon_tab1_press"]imageWithRenderingMode:(UIImageRenderingModeAlwaysOriginal)];
    

    ClassificationViewController * classVC = [[ClassificationViewController alloc]init];
    
    classVC.tabBarItem.title = @"分类";
    
    classVC.tabBarItem.image = [[UIImage imageNamed:@"icon_tab2_normal"]imageWithRenderingMode:(UIImageRenderingModeAlwaysOriginal)];
    classVC.tabBarItem.selectedImage =[[UIImage imageNamed:@"icon_tab2_press"]imageWithRenderingMode:(UIImageRenderingModeAlwaysOriginal)];
    
    MessageViewController * messageVC = [[MessageViewController alloc]init];
    messageVC.tabBarItem.title = @"消息";
    
    messageVC.tabBarItem.image = [[UIImage imageNamed:@"icon_tab3_normal"]imageWithRenderingMode:(UIImageRenderingModeAlwaysOriginal)];
     messageVC.tabBarItem.selectedImage =[[UIImage imageNamed:@"icon_tab3_press"]imageWithRenderingMode:(UIImageRenderingModeAlwaysOriginal)];
    
    PersonalViewController * personalVC = [[PersonalViewController alloc]init];
    personalVC.tabBarItem.title = @"我";
    personalVC.tabBarItem.image = [[UIImage imageNamed:@"icon_tab4_normal"]imageWithRenderingMode:(UIImageRenderingModeAlwaysOriginal)];
    personalVC.tabBarItem.selectedImage =[[UIImage imageNamed:@"icon_tab4_press"]imageWithRenderingMode:(UIImageRenderingModeAlwaysOriginal)];
    
    bar.viewControllers = @[firstVC,classVC,messageVC,personalVC];
    UIWindow * window =[[[UIApplication sharedApplication]delegate]window];
    window.rootViewController =bar;
    
}




- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
